//返回原对象属性
const person = {
	name: 'Boson',
	age: 20,
	address: {
	  city: 'Chongqing',
	  area: 'Nanan'
	}
  }
  let {name,age, address:{city,area } } =person;
  console.log(name,age,city,area);
  //加法函数
  let arr1=[1,9,5,7];
  let sum=0;
  function add(arr1){
    for(i=0;i<arr1.length;i++){
       sum+=arr1[i];
      }
    return sum;
  }
  console.log(add(arr1));
   //任意调用mypush
  Array.prototype.myPush=function(x){
    let y=arr.push(x);
    return y;
  }
  let arr=[1,2,3,4];
  arr.myPush(5);
  console.log(arr);
  
//继承函数
function MyFunction(){};
MyFunction.prototype.__proto__=Array.prototype;
const son=new MyFunction;
console.log(son);

